x86/VPMU: when handling MSR accesses, leave fault injection to callers
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Thu, 9 Jul 2015 11:53:03 +0000 (13:53 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Jul 2015 11:53:03 +0000 (13:53 +0200)
commit23b477dfa696f0080e5910d129bc1986626f5d51
treeab772f247f3f33a006bb750dd486437692817bc7
parenta03bfb9166b9aa0ea611e44359282e9c39362481
x86/VPMU: when handling MSR accesses, leave fault injection to callers

Hypervisor cannot easily inject faults into PV guests from arch-specific VPMU
read/write MSR handlers (unlike it is in the case of HVM guests).

With this patch vpmu_do_msr() will return an error code to indicate whether an
error was encountered during MSR processing (instead of stating that the access
was to a VPMU register). The caller will then decide how to deal with the error.

As part of this patch we also check for validity of certain MSR accesses right
when we determine which register is being written, as opposed to postponing this
until later.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/vpmu.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vpmu_core2.c